<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.com">
<head>
    <meta charset="UTF-8">
    <title>头部页面</title>
</head>
<body>
    <div id="top" th:fragment="top">
        <link type="text/css" rel="stylesheet" href="/css/front.css"/>
        <div id="top_bar">
            <nav>
                <span>
                    <a href="admin/login_show">进入后台</a>
                </span>
                <span>|</span>
                <span>注册</span>
                <span>|</span>
                <span>登录</span>
            </nav>
        </div>
        <div id = "banner">
            <img src="img/banner.jpg">
        </div>
        <div id="menu">
            <ul>
                <li><a href="/" th:class="${categoryId==null?'on':''}">首页</a></li>
                <th:block th:each="c:${categoryList}">
                    <li>
                        <a th:href="@{/second(categoryId=${c.categoryId})}"
                           th:text="${c.categoryName}"
                           th:class="${categoryId==c.categoryId?'on':''}"></a>
                    </li>
                </th:block>
            </ul>
        </div>
    </div>
</body>
</html>